from django.urls import converters

class UsernameConverter:
    regex='[0-9a-zA-Z_-]{5,20}'
    def to_python(self, value):
        return value

class MobileConverter:
    regex='1[0-9]{10}'
    def to_python(self, value):
        return value